home *** CD-ROM | disk | FTP | other *** search
/ Logiciels PC 7 / logiciel pc 7.iso / Linux / XFree86-3.3.3.1 / binaries / Linux-ix86-libc5 / postinst.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1999-02-08  |  4KB  |  149 lines

  1. #!/bin/sh
  2.  
  3. # $XFree86: xc/programs/Xserver/hw/xfree86/etc/postinst.sh,v 3.13.2.7 1998/11/01 11:19:28 hohndel Exp $
  4. #
  5. # postinst.sh (for XFree86 3.3.3)
  6. #
  7. # This script should be run after installing a new version of XFree86.
  8. #
  9.  
  10. RUNDIR=/usr/X11R6
  11.  
  12. if [ ! -d $RUNDIR/. ]; then
  13.     echo $RUNDIR does not exist
  14.     exit 1
  15. fi
  16.  
  17. # Make sure that the local fonts dir exists and create an empty
  18. # fonts.dir file if there is none
  19. if [ ! -d $RUNDIR/lib/X11/fonts/local ]; then
  20.     mkdir -p $RUNDIR/lib/X11/fonts/local
  21. fi
  22. if [ ! -f $RUNDIR/lib/X11/fonts/local/fonts.dir ]; then
  23.     echo "0" > $RUNDIR/lib/X11/fonts/local/fonts.dir
  24. fi
  25.  
  26. # Since the misc fonts are distributed in two parts, make sure that the
  27. # fonts.dir file is correct if only one part has been installed.
  28. if [ -d $RUNDIR/lib/X11/fonts/misc ]; then
  29.     echo ""
  30.     echo "Updating the fonts.dir file in $RUNDIR/lib/X11/fonts/misc"
  31.     echo "This might take a while ..."
  32.     $RUNDIR/bin/mkfontdir $RUNDIR/lib/X11/fonts/misc
  33. fi
  34.  
  35. # Check if the system has a termcap file
  36. TERMCAP1DIR=/usr/share
  37. TERMCAP2=/etc/termcap
  38. if [ -d $TERMCAP1DIR ]; then
  39.     TERMCAP1=`find $TERMCAP1DIR -type f -name termcap -print 2> /dev/null`
  40.     if [ x"$TERMCAP1" != x ]; then
  41.         TERMCAPFILE="$TERMCAP1"
  42.     fi
  43. fi
  44. if [ x"$TERMCAPFILE" = x ]; then
  45.     if [ -f $TERMCAP2 ]; then
  46.         TERMCAPFILE="$TERMCAP2"
  47.     fi
  48. fi
  49. if [ x"$TERMCAPFILE" != x -a `uname` != OpenBSD ]; then
  50.     echo ""
  51.     echo "You appear to have a termcap file: $TERMCAPFILE"
  52.     echo "This should be edited manually to replace the xterm entries"
  53.     echo "with those in $RUNDIR/lib/X11/etc/xterm.termcap"
  54.     echo ""
  55.     echo "Note: the new xterm entries are required to take full advantage"
  56.     echo "of new features, but they may cause problems when used with"
  57.     echo "older versions of xterm.  A terminal type 'xterm-r6' is included"
  58.     echo "for compatibility with the standard X11R6 version of xterm."
  59. fi
  60.  
  61. # Check for terminfo, and update the xterm entry
  62. TINFODIR=/usr/lib/terminfo
  63. OLDTINFO=" \
  64.     x/xterm \
  65.     x/xterms \
  66.     x/xterm-24 \
  67.     x/xterm-vi \
  68.     x/xterm-65 \
  69.     x/xterm-bold \
  70.     x/xtermm \
  71.     x/xterm-boldso \
  72.     x/xterm-ic \
  73.     x/xterm-r6 \
  74.     x/xterm-old \
  75.     x/xterm-r5 \
  76.     v/vs100"
  77.     
  78. if [ -d $TINFODIR ]; then
  79.     echo ""
  80.     echo "You appear to have a terminfo directory: $TINFODIR"
  81.     echo "New xterm terminfo entries can be installed now."
  82.     echo ""
  83.     echo "Note: the new xterm entries are required to take full advantage"
  84.     echo "of new features, but they may cause problems when used with"
  85.     echo "older versions of xterm.  A terminal type 'xterm-r6' is included"
  86.     echo "for compatibility with the standard X11R6 version of xterm."
  87.     echo ""
  88.     echo "Do you wish to have the new xterm terminfo entries installed now (y/n)?"
  89.     read Resp
  90.     case "$Resp" in
  91.     [yY]*)
  92.         echo ""
  93.         for t in $OLDTINFO; do
  94.             if [ -f $TINFODIR/$t ]; then
  95.                 echo "Moving old terminfo file $TINFODIR/$t to $TINFODIR/$t.bak"
  96.                 rm -f $TINFODIR/$t.bak
  97.                 mv -f $TINFODIR/$t $TINFODIR/$t.bak
  98.             fi
  99.         done
  100.         echo ""
  101.         echo "Installing new terminfo entries for xterm."
  102.         echo ""
  103.         echo "On some systems you may get warnings from tic about 'meml'"
  104.         echo "and 'memu'.  These warnings can safely be ignored."
  105.         echo ""
  106.         tic /usr/X11R6/lib/X11/etc/xterm.terminfo
  107.         ;;
  108.     *)
  109.         echo ""
  110.         echo "Not installing new terminfo entries for xterm."
  111.         echo "They can be installed later by running:"
  112.         echo ""
  113.         echo "  tic /usr/X11R6/lib/X11/etc/xterm.terminfo"
  114.         ;;
  115.     esac
  116. fi
  117.  
  118. if [ -f /usr/X11R6/bin/rstartd ]; then
  119.     echo ""
  120.     echo "If you are going to use rstart and /usr/X11R6/bin isn't in the"
  121.     echo "default path for commands run remotely via rsh, you will need"
  122.     echo "a link to rstartd installed in /usr/bin."
  123.     echo ""
  124.     echo "Do you wish to have this link installed (y/n)?"
  125.     read Resp
  126.     case "$Resp" in
  127.     [yY]*)
  128.         echo "Creating link from /usr/X11R6/bin/rstartd to /usr/bin/rstartd"
  129.         rm -f /usr/bin/rstartd
  130.         ln -s /usr/X11R6/bin/rstartd /usr/bin/rstartd
  131.         ;;
  132.     esac
  133. fi
  134.  
  135. case `uname` in
  136.     FreeBSD|NetBSD|OpenBSD)
  137.         echo ""
  138.         echo "Running ldconfig"
  139.         /sbin/ldconfig -m /usr/X11R6/lib
  140.         ;;
  141.     Linux)
  142.         echo ""
  143.         echo "Running ldconfig"
  144.         /sbin/ldconfig /usr/X11R6/lib
  145.         ;;
  146. esac
  147.  
  148. exit 0
  149.